$(function () {
    var vendorId = $("#vendorIdTemp").val();
    if(vendorId==0){
        $("#vendorId").val('');
        $("#vendorId").attr("disabled","disabled");
    }else{
        $("#vendorId").val('');
    }

});

function add(){
    var content = $("#content").val();
    if (content == null || content == "") {
        bootbox.alert("请输入模板内容");
        return false;
    }
    var param = "content="+content;
    $.ajax({
        type: 'post',
        url: '/template/save',
        data: param,
        success: function (data) {
            if (data.code == "0000") {
                alert(data.msg);
                window.location.href = "/template/list";
            } else {
                alert("保存失败");
                return false;
            }
        }
    });
}







